<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #a{
            width: 300px;
            height: 300px;
            border: 1px solid red;
        }
        #b{
            width: 100px;
            height: 100px;
            border: 1px solid red;
            box-sizing: border-box;/*防止设置内边距会增大盒子的宽度和高度，让width和height就是最终盒子的大小*/
        }
    </style>
</head>
<body>
    <div id="a">
        <div id="b">

        </div>
    </div>
</body>
</html>